import 'dart:ui' show window;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:logger/logger.dart';

class Config {
  static const int majorVersion = 1;
  static const int minorVersion = 0;
  static const int patchVersion = 0;

  static const isDebug = kReleaseMode;
  static const logLevel = kReleaseMode ? Level.warning : Level.verbose;

  static const appId = 'app';

  static String get version => "$majorVersion.$minorVersion.$patchVersion";

  static const String server = "https://www.shirne.com/api/";
  static const String imgHost = "https://www.shirne.com";

  static const jPushPkgName = 'com.shirne.webapp';
  static const jPushAppKey = 'x000';
  static const jPushChannel = 'default';

  static double windowWidth = 0;
  static double windowHeight = 0;
  static double pixelRatio = 0;

  static double windowPixelWidth = 0;
  static double windowPixelHeight = 0;

  static init(BuildContext context) {
    windowWidth = window.physicalSize.width;
    windowHeight = window.physicalSize.height;
    pixelRatio = window.devicePixelRatio;

    windowPixelWidth = windowWidth / pixelRatio;
    windowPixelHeight = windowHeight / pixelRatio;
  }
}
